package org.senzacontrollo.designPatterns.builder;

/**
 *  Fornisce le operazioni concrete dell'interfaccia corrispondente al builder
 */

public class OrientedERBuilder extends ModelBuilder{

	private StringBuilder modelToShow;
	
	public OrientedERBuilder() {
		modelToShow = new StringBuilder();
	}
	
	@Override
	public void addEntity(String name) {
		modelToShow.append(name);
	}

	@Override
	public void addRelationship(String from, String to, String relationship) {
		modelToShow.append(from + " " + to + " " + relationship);
		 
	}

	@Override
	public void addCardMin(String entity, String relationship, String value) {
		modelToShow.append(entity + " " + relationship + " " + value);
		
	}

	@Override
	public void addCardMax(String entity, String relationship, String value) {
		modelToShow.append(entity + " " + relationship + " " + value);
		
	}

	@Override
	public Object getModel() {
		return modelToShow;
	}

}
